﻿namespace WMS.FC.Domain.DomainObject.System
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class SplitTableIndexAttribute : Attribute
    {
        /// <summary>
        /// 索引名称
        /// </summary>
        public string IndexName { get; set; } = string.Empty;

        /// <summary>
        /// 列名称
        /// </summary>
        public List<string> PropertyNameList { get; set; } = new List<string>();

        /// <summary>
        /// 是否唯一
        /// </summary>
        public bool IsUnique { get; set; } = false;

        public SplitTableIndexAttribute(string indexName, string fieldName1, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, string fieldName10, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            PropertyNameList.Add(fieldName10);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, string fieldName10, string fieldName11, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            PropertyNameList.Add(fieldName10);
            PropertyNameList.Add(fieldName11);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, string fieldName10, string fieldName11, string fieldName12, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            PropertyNameList.Add(fieldName10);
            PropertyNameList.Add(fieldName11);
            PropertyNameList.Add(fieldName12);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, string fieldName10, string fieldName11, string fieldName12, string fieldName13, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            PropertyNameList.Add(fieldName10);
            PropertyNameList.Add(fieldName11);
            PropertyNameList.Add(fieldName12);
            PropertyNameList.Add(fieldName13);
            IsUnique = isUnique;
        }

        public SplitTableIndexAttribute(string indexName, string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5, string fieldName6, string fieldName7, string fieldName8, string fieldName9, string fieldName10, string fieldName11, string fieldName12, string fieldName13, string fieldName14, bool isUnique)
        {
            IndexName = indexName;
            PropertyNameList.Add(fieldName1);
            PropertyNameList.Add(fieldName2);
            PropertyNameList.Add(fieldName3);
            PropertyNameList.Add(fieldName4);
            PropertyNameList.Add(fieldName5);
            PropertyNameList.Add(fieldName6);
            PropertyNameList.Add(fieldName7);
            PropertyNameList.Add(fieldName8);
            PropertyNameList.Add(fieldName9);
            PropertyNameList.Add(fieldName10);
            PropertyNameList.Add(fieldName11);
            PropertyNameList.Add(fieldName12);
            PropertyNameList.Add(fieldName13);
            PropertyNameList.Add(fieldName14);
            IsUnique = isUnique;
        }
    }
}
